<template>
  <div>
    <div style="display: flex;flex-wrap:wrap;margin-top:20px;float:right;margin-right:20px;">
      <el-button type="primary" icon="el-icon-plus">添加资料</el-button>
      <el-button type="danger" icon="el-icon-delete">删除资料</el-button>
      <el-button type="primary" icon="el-icon-upload">导入资料</el-button>
      <el-button type="primary" icon="el-icon-download">导出资料</el-button>
    </div>
    <div style="margin-top:20px;margin-right:20px;margin-left:20px;">
      <el-table
        :data="tableData"
        border
        style="width: 100% ;top: 25px">
        <el-table-column
          type="selection"
          width="55">
        </el-table-column>
        <el-table-column
          fixed
          prop="id"
          label="序号"
          width="150">
        </el-table-column>
        <el-table-column
          prop="name"
          label="题目"
          width="220">
        </el-table-column>
        <el-table-column
          prop="province"
          label="创建者"
          width="220">
        </el-table-column>
        <el-table-column
          prop="date"
          label="创建日期"
          width="220">
        </el-table-column>
        <el-table-column
          fixed="right"
          label="操作"
          width="150">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
            <el-button type="text" size="small">发布</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    handleClick(row) {
      console.log(row);
    }
  },

  data() {
    return {
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        province: '上海',
        id: '01',
        zip: 200333
      }, {
        date: '2016-05-04',
        name: '王小虎',
        province: '上海',
        id: '02',
        zip: 200333
      }]
    }
  }
}
</script>
